import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        //队列
        Queue<Integer> queue = new LinkedList<>();
        Deque<Integer> deque = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        System.out.println(queue.poll());
        System.out.println(queue.peek());
    }
    public static void main3(String[] args) {
        //链式栈
        LinkedList<Integer> stack = new LinkedList<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        System.out.println(stack.peek());
    }
    public static void main1(String[] args) {
        //栈的模拟实现
        MyStack myStack = new MyStack(1);
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        myStack.push(4);
        myStack.push(5);
        Integer integer = myStack.pop();
        myStack.pop();
        myStack.pop();
        myStack.pop();
//        myStack.pop();
//        myStack.pop();
        System.out.println(integer);
        System.out.println(myStack.peek());
        System.out.println(myStack.isEmpty());

    }



    public static void main2(String[] args) {
        //栈的使用
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        System.out.println(stack.size());
        System.out.println(stack);
        Integer integer = stack.pop();
        System.out.println(integer);
        System.out.println(stack);
        System.out.println(stack.peek());
        System.out.println(stack.empty());
    }
}
